package org.zoomdev.zoom.dao.adapters.parameter;

import org.zoomdev.zoom.dao.adapters.ParameterAdapter;

import java.sql.PreparedStatement;
import java.sql.SQLException;

// 字符串适配器
public class ToStringParameterAdapter implements ParameterAdapter<Object> {
    public static final ToStringParameterAdapter ADAPTER = new ToStringParameterAdapter();

    @Override
    public void setNonnullParameter(PreparedStatement ps, int index, Object data) throws SQLException {
        ps.setString(index, data.toString());
    }
}
